/*
 *  MenuItem Class
 *
 *      Natural Ordering - NAME
 */

package project7.Storage;


public class MenuItem implements Comparable{

    /*------ Private Variables -----------------------------------------------*/

    private String name = "";
    private double price = 0.0;
    private String category = "";

    /*------ Constructors ----------------------------------------------------*/

    public MenuItem(String itemName, double itemPrice, String cat){
        name = itemName;
        price = itemPrice;
        category = cat;
    }

    /*------ Accessors and Mutators ------------------------------------------*/

    public String getName(){ return name; }
    public void setName(String itemName){ name = itemName; }

    public double getPrice(){ return price; }
    public void setPrice(double itemPrice){ price = itemPrice; }

    public String getCategory(){ return category; }
    public void setCategory(String itemCategory){ category = itemCategory; }

    /*------ Overrides -------------------------------------------------------*/

    @Override
    public String toString(){
        return "" + category + " " + name + "      " + price;
    }

    public int compareTo(Object o) {
        MenuItem temp = (MenuItem) o;
        return name.compareTo(temp.getName());
    }


}
